package com.globallogic.javatrainings.sergiiivanov.view;

import com.globallogic.javatrainings.sergiiivanov.resources.Messages;

public class StudentDetailsPage extends GUI {
    public final int menuOffset = 4;

    public void showAvailableCoursesList(String[] coursesList) {
        show("Select course to assign");
        showArrayAsList(coursesList);
        show("or enter any other number to cancel");
    }

    public void ShowAverageScores(String[][] studentsScoreAverage) {
        show("Average scores :");
        showTableOrdered(studentsScoreAverage);
        showLineOfList(Messages.MENU_BACK, 0);
    }

    public void showResume(String[][] resume) {
        show("Resume:");
        showTableOrdered(resume, menuOffset);
        show("select item to remove or ...");
        showLineOfList("Add new record", resume.length + menuOffset);
    }

    public void showStudentCourses(String[] assignedCoursesArray) {
        show(Messages.ASSIGNED_TO_COURSES);
        showArrayAsList(assignedCoursesArray, menuOffset);
        show(Messages.SELECT_COURSE_IF_YOU_WANT_TO_UNASSIGN_STUDENT_FROM_ONE);
        showLineOfList(Messages.ENROLL_TO_OTHER_COURSE,
                assignedCoursesArray.length + 4);

    }

    public void ShowStudentScores(String[][] scoresTable) {
        show("Scores:");
        showTableOrdered(scoresTable);
        show("Actions:");
        showLineOfList(Messages.MENU_BACK, 0);
        showLineOfList("Show average per discipline", 1);
    }

    public void studentPageHeader(String universityTitle) {
        newPage();
        show(universityTitle + " > Student details");
    }

    public void studentMenu() {
        showLineOfList(Messages.MENU_BACK, 0);
        showLineOfList("Show resume", 1);
        showLineOfList("Show courses", 2);
        showLineOfList("Show scores", 3);
    }
}
